/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vehicles;

import javax.swing.JOptionPane;

/**
 *
 * @author jonesbr
 */
public class Driver {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        System.out.println("In Main.");

        // make a method call to promptUser
        promptUser();
    }

    public static void promptUser() {
        System.out.println("In promptUser");
        System.out.println("");
        
        // create a car object to store our values.
        // Declare a variable of type Car, named myCar.
        // initialize the Car variable by calling the constructor.
        Car myCar = new Car();
        
        String strOdometer = JOptionPane.showInputDialog("What is the odometer?");
        
        // Convert String data to int data.
        int intOdometer = Integer.parseInt(strOdometer);
        
       // assign these values to our car.
        myCar.setOdometer(intOdometer);
        
        // prompt for Trip Odometer.
        String strTripOdometer = JOptionPane.showInputDialog("What is the trip odometer");
        
        // Convert from String to int.
        int intTripOdometer = Integer.parseInt(strTripOdometer);
        myCar.setTripOdometer(intTripOdometer);
        
        // prompt for miles per gallon.
        String strMilesPerGallon = JOptionPane.showInputDialog("What are the Miles per Gallon");
        
        // convert miles per gallon from STring to int and store in the Car.
        int intMilesPerGallon = Integer.parseInt(strMilesPerGallon);
        myCar.setMilesPerGallon(intMilesPerGallon);
        
        // prompt for gallons of gas.
        String strGallonsOfGas = JOptionPane.showInputDialog("What are the gallons of gas?");
        
        // convert gallons of gas and store in myCar.
        double dblGallonsOfGas = Double.parseDouble(strGallonsOfGas);
        myCar.setGallonsOfGas(dblGallonsOfGas);
        
        // prompt for distance.
        String strDistance = JOptionPane.showInputDialog("How far do you want to go?");
        
        // convert from String to int
        int intDistance = Integer.parseInt(strDistance);
        myCar.go(intDistance);
    }
}
